using System;
using System.Collections.Generic;
using System.Text;
using Ghasam.Business.Domain.Entity;
using NHibernate;
using NHibernate.Expression;

namespace Ghasam.Business.DAO.Impl
{
    public class PaymentChequeDao : DaoBase<PaymentCheque>, IPaymentChequeDao
    {
        public IList<PaymentCheque> FindAllPaymentByParam(bool isFormal)
        {
            ICriteria cri = Session.CreateCriteria(typeof(PaymentCheque));
            cri.CreateAlias("Customer", "customer");
            //if (isFormal = -1)
            cri.Add(Expression.Eq("customer.IsFormal", isFormal));
            return cri.List<PaymentCheque>();
        }
    }
}
